package com.hmdp.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * date: 2023/9/13 18:42
 * author: MR.孙
 */
@Configuration
public class RedissonConfiguration {

    @Bean
    public RedissonClient redissonClient() {
        Config config = new Config();
        // Redis 地址和密码（useSingleServer 单节点，useClusterServers 集群）
        config.useSingleServer().setAddress("redis://192.168.187.129:6379").setPassword("123321");
        // 创建客户端
        return Redisson.create(config);
    }


}
